<template>
	<view>
		<index-header></index-header>
		<view class="content">
			<view class="city">
				<text>当前定位城市</text>
				<view class="city_list current_city">南京市</view>
				<view class="city_list_list">
					<view class="city_list">全球</view>
					<view class="city_list">国内</view>
					<view class="city_list">国外</view>
				</view>
			</view>
			<view class="city">
				<text>热门城市</text><text class="more" @tap="openLevel">更多城市 ></text>
				<view class="city_list_list">
					<view class="city_list">北京市</view>
					<view class="city_list">上海市</view>
					<view class="city_list">广州市</view>
					<view class="city_list">深圳市</view>
					<view class="city_list">武汉市</view>
					<view class="city_list">南京市</view>
					<view class="city_list">杭州市</view>
				</view>
			</view>
			
			<level-linkage ref="levelLinkage" 
			            :pickerValueDefault="pickerValueDefault" 
			            :allData="treeData"
			            @onConfirm="onConfirm" themeColor='#007AFF'></level-linkage>
			<view class="city">
				<text>热门国家</text>
				<view class="city_list_list">
					<view class="city_list">法国</view>
					<view class="city_list">美国</view>
					<view class="city_list">俄罗斯</view>
					<view class="city_list">英国</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import levelLinkage from "@/components/pick-cityage/linkage.vue"
	import Tabbar from '@/components/bottomNav.vue'
	export default {
		components:{
			 'view-tabbar': Tabbar,
			 levelLinkage
		},
		data() {
			return {
				treeData:[
					{
						"id":"1",
						"name":"北京市",
						"code":"11",
						"children":[{
							"id":"1230040276324601858",
							"name":"朝阳区",
							"code":"10001"
						},
						{
							"id":"1230040276500762626",
							"name":"大同区",
							"code":"10003"
						}],
					},{
						"id":"2",
						"name":"上海市",
						"code":"22",
						"children":[{
							"id":"1230040276324601838",
							"name":"静安区",
							"code":"10004"
						},
						{
							"id":"1230040276500762642",
							"name":"闵行区",
							"code":"10005"
						}]
					}
				]
			}
		},
		methods: {
			openLevel() {
				this.$refs.levelLinkage.open();
			},
		}
	}
</script>

<style lang="scss">
	.content {
		width: 750upx;
		height: auto;
		padding-top: 108upx;
		min-height: calc(100% - 523upx);
		
		.city {
			margin: 10upx;
			display: flex;
			flex-direction: column;
			position: relative;
			text {
				margin-top: 20upx;
				margin-left: 10upx;
				font-size: 10upx;
				color: #333333;
				
				&.more {
					position: absolute;
					right: 20upx;
					top: 0;
					color: #165E8E;
				}
			}
			
			
			
			.city_list {
				margin-left: 10upx;
				margin-top: 10upx;
				width: 230upx;
				height: 60upx;
				border: 1upx solid #D8D8D8;
				border-radius: 8upx;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
				
				&.current_city {
					margin-bottom: 60upx;
				}
			}
			
			.city_list_list {
				display: flex;
				flex-direction: row;
				flex-wrap: wrap;
			}
		}
	}
</style>
